"use strict";

/**
 * @auther wtfssd
 * Created by wtfssd on 2017/10/31
 */
import * as React from 'react'
import {searchStyles} from "../../assets/styles/search";
import MyText from "../../component/MyText";
import Line from "../../component/Line";
import {SCREEN_WIDTH} from "../../constant";
import {autoSize} from "../../assets/styles/common";

const {View, Image, TouchableOpacity} = require('react-native');
const {connect} = require('react-redux');

class SearchResultItem extends React.Component<any, any> {
    render() {
        const {avatar, name, sub, detail, onPress} = this.props;
        return (
            <TouchableOpacity style={searchStyles.itemContainer} onPress={onPress}>
                <Image source={avatar} style={searchStyles.avatar}/>
                <View style={searchStyles.itemLeftContent}>
                    <MyText style={searchStyles.name}>{name}</MyText>
                    <MyText style={searchStyles.sub}>{sub}</MyText>
                    <MyText style={searchStyles.detail}>{detail}</MyText>
                </View>
                <Line style={searchStyles.itemLine} width={SCREEN_WIDTH - 100}/>
            </TouchableOpacity>
        );
    }
}


export default SearchResultItem;